package com.fangshuoit.validator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Created by Fangshuo_zhou on 2018/1/28.
 */
//可以标注在方法和字段上
@Target({ElementType.METHOD, ElementType.FIELD})
//运行时的注解
@Retention(RetentionPolicy.RUNTIME)
//用于校验的注解，这个注解使用在某个类上面,由这个类来执行校验逻辑
@Constraint(validatedBy = MyConstraintValidator.class)
public @interface MyConstraint {
    String message();

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
